package com.mt.restaurant.entity.sale;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@DEntity(label="销售订单",comment="",moduleLabel="销售管理")
@Entity(name="restaurant_sale_order")
@Table(name = "restaurant_sale_order" , indexes = {   })
@ApiModel(description = "销售订单:")
public class SaleOrder extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="桌号",comment="菜谱",component="数字，整数",where=false)
	@ApiModelProperty(value = "桌号:菜谱")
	@Column(name="desk_num",length=255,nullable=false,unique=false)
	private Integer deskNum;

	@DColumn(index=4,label="销售价格",comment="销售价格",component="数字，小数",where=false)
	@ApiModelProperty(value = "销售价格:销售价格")
	@Column(name="price",length=255,nullable=false,unique=false)
	private Double price;

	@DColumn(index=5,label="销售时间",comment="销售时间",component="日期选择",where=false)
	@ApiModelProperty(value = "销售时间:销售时间")
	@Column(name="sale_date",length=255,nullable=true,unique=false)
	@JsonSerialize(using = DateSerializer.class)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date saleDate;

	@Transient
	private List<MenuSaleRecord> menuSaleRecords;

	public List<MenuSaleRecord> getMenuSaleRecords() {
		return menuSaleRecords;
	}

	public void setMenuSaleRecords(List<MenuSaleRecord> menuSaleRecords) {
		this.menuSaleRecords = menuSaleRecords;
	}

	public Integer getDeskNum() {
		return this.deskNum;
	}

	public void setDeskNum(Integer deskNum) {
		this.deskNum = deskNum;
	}

	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Date getSaleDate() {
		return this.saleDate;
	}

	public void setSaleDate(Date saleDate) {
		this.saleDate = saleDate;
	}



}
